#include "StdAfx.h"
#include "FunctionInfo.h"

CFunctionInfo::CFunctionInfo(FunctionID functionID)
{
	CFunctionInfo::functionID = functionID;
	m_callCount = 0;
	_funcName = NULL;
	_className = NULL;
	_moduleName = NULL;
	_assemblyName = NULL;
}

CFunctionInfo::~CFunctionInfo()
{
	// free the allocated strings
	free(_funcName);
	free(_className);
	free(_moduleName);
	free(_assemblyName);

}

//Getter and setter

void CFunctionInfo::SetFuncName(WCHAR* funcName)
{
	_funcName = _wcsdup(funcName);
}

WCHAR* CFunctionInfo::GetFuncName()
{
	if(_funcName != NULL) return _funcName;
	else return NULL;
}

void CFunctionInfo::SetClassName(WCHAR* className)
{
	_className = _wcsdup(className);
}

WCHAR* CFunctionInfo::GetClassName()
{
	if(_className != NULL) return _className;
	else return NULL;
}

void CFunctionInfo::SetModuleName(WCHAR* moduleName)
{
	_moduleName = _wcsdup(moduleName);
}

WCHAR* CFunctionInfo::GetModuleName()
{
	if(_moduleName != NULL) return _moduleName;
	else return NULL;
}

void CFunctionInfo::SetAssemblyName(WCHAR* assemblyName)
{
	_assemblyName = _wcsdup(assemblyName);
}

WCHAR* CFunctionInfo::GetAssemblyName()
{
	if(_assemblyName != NULL) return _assemblyName;
	else return NULL;
}

long CFunctionInfo::GetCallCount()
{
	return m_callCount;
}

void CFunctionInfo::IncrementCallCount()
{
	m_callCount++;
}